﻿@using Easy
@using Microsoft.Practices.ServiceLocation
@{
    var layOut = ViewData[Easy.Web.CMS.Layout.LayoutEntity.LayoutKey] as Easy.Web.CMS.Layout.LayoutEntity;
    if (layOut == null)
    {
        return;
    }
}
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="zh"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="zh"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="zh"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html class="not-ie" lang="zh">
<!--<![endif]-->
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta charset="utf-8" />
    <title>@layOut.Page.Title</title>
    <meta name="keywords" content="@layOut.Page.MetaKeyWorlds" />
    <meta name="description" content="@layOut.Page.MetaDescription"/>
    <meta name="author" content="www.zkea.net"/>
    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no,maximum-scale=1.0" />
    @StyleAtHead()
    @ScriptAtHead()
    @if (!layOut.Theme.IsNullOrEmpty())
    {
        if (HttpContext.Current.IsDebuggingEnabled)
        {
            <link type="text/css" rel="stylesheet" href="@Url.Content("~/Themes/{0}/css/Theme.css".FormatWith(layOut.Theme))"/>
        }
        else
        {
            <link type="text/css" rel="stylesheet" href="@Url.Content("~/Themes/{0}/css/Theme.min.css".FormatWith(layOut.Theme))"/>
        }
    }

</head>
<body class="front">
    @if (Request.IsAuthenticated)
    {
        <div class="preview-toolbar">
            <div class="btn-group">
                <a class="btn btn-primary" href="@Url.Action("Design", "Page", new {module = "common", ID = layOut.Page.ID})">
                    <i class="glyphicon glyphicon-wrench"></i>
                    设计
                </a>
                <a class="btn btn-primary" href="@Url.Action("Index", "Page", new { module = "Common", PageID = layOut.Page.ID })">
                    <i class="glyphicon glyphicon-th"></i>
                    概览
                </a>
                <a class="btn btn-primary" href="@Url.Action("Edit", "Page", new {module = "common", ID = layOut.Page.ID})">
                    <i class="glyphicon glyphicon-edit"></i>
                    属性
                </a>
                @Html.Partial("Partial.Menu", layOut)
            </div>
        </div>
    }
    <div id="container" class="@layOut.ContainerClass">
        @RenderBody()
    </div>

    @StyleAtFoot()
    @ScriptAtFoot()
    @if (!layOut.Style.IsNullOrEmpty())
    {
        <link href="@Url.Content(layOut.Style)" rel="stylesheet" />

    }
    @if (!layOut.Page.Style.IsNullOrEmpty())
    {
        <link href="@Url.Content(layOut.Page.Style)" rel="stylesheet" />

    }
    @if (!layOut.Script.IsNullOrEmpty())
    {
        <script type="text/javascript" src="@Url.Content(layOut.Script)"></script>
    }
    @if (!layOut.Page.Script.IsNullOrEmpty())
    {
        <script type="text/javascript" src="@Url.Content(layOut.Page.Script)"></script>
    }
</body>
</html>